<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>系统消息</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>

<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/user/tbMsgNotityList">消息记录</a></li>
	</ul>
	<form id="searchForm" modelAttribute="tbMsgNotify" class="breadcrumb form-search" action="/a/sys/user/tbMsgNotityList" method="post">
		<input id="pageNo" name="pageNo" type="hidden" value="1"/>
		<input id="pageSize" name="pageSize" type="hidden" value="30"/>
		<label>状态：</label>
		<select maxlength="50" class="input-medium" name="status">
			<option value="-1">全部</option>
			<option value="0" <c:if test="${tbMsgNotify.status==0}"> selected </c:if> >未读</option>
			<option value="1" <c:if test="${tbMsgNotify.status==1}"> selected </c:if>>已读</option>
		</select>
		<span style="margin-top:8px;">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
		</span>
	</form>
	<span><font style="color: #00A6C7">${message1}</font></span>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr>
			<th>消息标题</th>
			<th>消息内容</th>
			<th>状态</th>
			<th>创建时间</th>
		    <th>操作</th>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="page">
		<tr>
			<td>${page.title}</td>
			<td>${page.content}</td>
			<td>
				<c:choose>
					<c:when test="${page.status==0}">未读</c:when>
					<c:when test="${page.status==1}">已读</c:when>
				</c:choose>
			</td>
			<td><fmt:formatDate value="${page.createTime}" type="both"/></td>
			<td>
				<c:choose>
					<c:when test="${page.status==0}"><a href="${ctx}/sys/user/getMsg?id=${page.id}">已读</a></c:when>
				</c:choose>
				</td>
		</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>